function* IdGenerator() {
  let id = 0;
  while (true) {
    yield ++id;
  }
}

const idIterator = IdGenerator();
const idIterator2 = IdGenerator();

let obj1 = { id: idIterator.next().value, msg: 'bilibili：Jimmyhao' };
let obj2 = { id: idIterator.next().value, msg: '公众号：Jimmyhao' };
let obj3 = {
  id: idIterator.next().value,
  msg: '在线文档：http://www.jimmyxuexue.top:999/',
};

console.log(obj1);
console.log(obj2);
console.log(obj3);
